package com.followmeandroid.models;

import com.google.android.gms.maps.model.LatLng;

import java.util.Date;
import java.util.UUID;

/**
 * <p>Title: Location</p>
 * <p>Description: Class for storing information
 * on locations to be used with Google Maps.</p>
 * @author Tyler Johnson
 * @email tyler.johnson@my.uwrf.edu
 * @date 11/16/2014
 * @team Adam Drews
 * @email  adam.drews@my.uwrf.edu
 * @team Nicholas Thorp
 * @email nicholas.thorp@my.uwrf.edu
 */
public class Location {

    private UUID id;
    private double Longitude;
    private double Latitude;
    private String note;
    private Date date;

    /**
     * Default constructor. Sets the date to the current date,
     * and the latitude and longitude to (0.0, 0.0).
     */
    public Location() {
        this.date = new Date();
        this.Latitude = 0.0;
        this.Longitude = 0.0;
    }

    /**
     * Constructor - Sets the date, latitude, and longitude to the
     * given parameters.
     * @param date      The date for this location.
     * @param lat       The latitude of this location.
     * @param Long      The longitude of this location.
     */
    public Location(Date date, double lat, double Long) {
        this.date = date;
        this.Latitude = lat;
        this.Longitude = Long;
    }

    /**
     * Returns the date associated with this location.
     * @return this.date    The date of this location.
     */
    public Date getDate() {
        return this.date;
    }

    /**
     * Returns teh latitude of this location.
     * @return this.Latitude    The latitude of this location.
     */
    public double getLat() {
        return this.Latitude;
    }

    /**
     * Returns the longitude of this location.
     * @return this.Longitude   The longitude of this location.
     */
    public double getLong() {
        return this.Longitude;
    }

    /**
     * The way to get the information from this is
     * String data[] = getLongAndLat().split("/");
     * double Long = Double.parseDouble(data[0]);
     * double Lat = Double.parseDouble(data[1]);
     *
     * @return the longitude and latitude in the form of a Long/Lat
     */
    public String getLongAndLat() {
        return this.Latitude + "/" + this.Latitude;
    }

    /**
     * Returns a LatLng object, with the values of Latitude and Longitude
     * as its coordinates.
     * @return new LatLng from current location.
     */
    public LatLng getLocation(){return new LatLng(this.Latitude, this.Longitude);}
}
